import {service} from "@/api/index";

function getUsers() {
    return service.get("/user/getList/0/10/1")
}

function getUserById(id) {
    return service.get("/user/" + id)
}

function deleteUser(id) {
    return service.delete("/user/" + id)
}

function registerUser(user) {

    // {
    //     "avatar": "",
    //     "createTime": "",
    //     "id": 0,
    //     "mail": "",
    //     "name": "",
    //     "password": "",
    //     "phone": "",
    //     "updateTime": ""
    // }

    return service.post("/user/register", user)
}

function editUser(data, id) {
    return service.put("/user/" + id, data)
}

function login(data) {
    return service.post("/user/login", data)
}
function getUser() {
    return service.get("/user/getUser")
}
function logout() {
    return service.get("/user/logout")
}
export default {
    getUsers,
    getUser,
    deleteUser,
    editUser,
    registerUser,
    login,
    logout,
    getUserById
}
